<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
        $(function(){
            var startDate =$('#startDate').val();
            var date = currentTime();
            if(startDate<date){
                $('#date').val(date);
            }
        });
        function currentTime() {
            var now = new Date();
            var year = now.getFullYear();
            var month = now.getMonth() + 1;
            var day = now.getDate();
            var hh = now.getHours();
            var mm = now.getMinutes();
            var ss = now.getSeconds();
            var clock = year + "-";
            if (month < 10)
                clock += "0";
            clock += month + "-";
            if (day < 10)
                clock += "0";
            clock += day + " ";
            if (hh < 10)
                clock += "0";
            clock += hh + ":";
            if (mm < 10)
                clock += '0';
            clock += mm + ":";
            if (ss < 10)
                clock += '0';
            clock += ss;
            return (clock);

        }

        function changePrice(inputId,inputId2){
            var inputValue = $.trim($("#"+inputId).val());
            if(inputValue!=null&&inputValue!=''){
                $("#"+inputId2).val(inputValue);
            }
        }

</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#"   onclick="loadDiv('priceRightDiv','${ctx}/csm/expPrice/indexModify?expInfo.expDict.expCode=${expPrice.expInfo.expDict.expCode}')">消耗品价格列表</a>
                </li>
                <%--<li>--%>
                    <%--<a href="#" onclick="loadDiv('priceRightDiv','${ctx}/csm/expPrice/formModify?expInfo.expDict.expCode=${expPrice.expInfo.expDict.expCode}')">消耗品价格添加</a>--%>
                <%--</li>--%>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                            	<form:form id="searchPriceForm" modelAttribute="expPrice"  onsubmit="return loadDivForm('priceRightDiv','searchPriceForm','${ctx}/csm/expPrice/indexModify');" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                </form:form>
                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered mg-t datatable">
                            <thead>
                                <tr>
                                    <th>代码</th>
                                    <th>品名</th>
                                    <th>规格</th>
                                    <th>单位</th>
                                    <th>市场批发价/元</th>
                                    <th>市场零售价/元</th>
                                    <th>起用日期</th>
                                 <%--   <th>费用分类</th>
                                    <th>核算项目分类</th>
                                    <th>会计科目</th>
                                    <th>病案首页分类</th>--%>
                                    <th>最高限价/元</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="expPrice">
                                <tr>
                                    <td> ${expPrice.expInfo.expDict.expCode}</td>
                                    <td> ${expPrice.expInfo.expDict.expName}</td>
                                    <td> ${expPrice.packageSpec}</td>
                                    <td> ${fns:getDictLabels(expPrice.units, 'SPEC_UNIT', '')}</td>
                                    <td> ${expPrice.tradePrice}</td>
                                    <td> ${expPrice.retailPrice}</td>
                                    <td> <fmt:formatDate value="${expPrice.startDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                                 <%--   <td> ${fns:getDictLabels(expPrice.classOnRcpt, 'RECK_ITEM_CLASS_DICT', '')}</td>
                                    <td> ${fns:getDictLabels(expPrice.classOnReckoning, 'RECK_ITEM_CLASS_DICT', '')}</td>
                                    <td> ${fns:getDictLabels(expPrice.subjCode, 'TALLY_SUBJECT_DICT', '')}</td>
                                    <td> ${expPrice.classOnMr}</td>--%>
                                    <td> ${expPrice.priceMax}</td>
                                    <td>
                                        <c:if test="${expPrice.stopDate ==null}">
                                        <a href="#" onclick="loadDiv('priceRightDiv','${ctx}/csm/expPrice/formModify?id=${expPrice.id}')" class="btn btn-primary btn-xs">调整价格</a>
                                        </c:if>
                                    </td>
                                </tr>
                            </c:forEach>

                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>